/* eslint-disable @typescript-eslint/no-namespace */

import { AnyObject } from 'antd/es/_util/type'

export declare namespace API {
  type Response<T> = {
    errcode: number
    errmsg: string
    result: T
  }

  type LoginReq = {
    idcard: string
    imageBase64: string
  }

  type LoginRes = Response<{
    userIdCard: string
    loginLogId: string
    accessCode: string
    useridList: {
      userId: string
      corpId: string
      corpName: string
      nickName: string
      corpLogoUrl: string
      userUuid: string
      auditStatus: number
      auditRemark: string
      name: string
    }[]
  }>

  type GetTokenReq = {
    userUuid?: string
    userId?: string
    corpId?: string
    clientInfo: ClientInfo
    access_code: string
  }

  type GetTokenRes = Response<{
    userUuid: string
    userId: string
    corpId: string
    jwtToken: string
  }>

  type ClientInfo = {
    clientType: ClientType
    deviceFingerprint: string
    CPUArchitecture?: string
    IPs?: string
    KernelType?: string
    KernelVersion?: string
    ProductName?: string
    UserHomeDirectory?: string
  }

  enum ClientType {
    PC = 1,
    Mobile = 2,
    Broswer = 3,
  }

  type ResetPasswordReq = {
    userIdcardNum: string
    pinPwd: string
  }

  type ResetPasswordRes = {
    errcode: number
    errmsg: string
    result: AnyObject
  }
}
